#ifndef GAME_FIELD_H
#define GAME_FIELD_H

#include <game_controller.h>

class GameController;


class GameField : public QWidget {
	Q_OBJECT
public:
	GameField (GameController * _gc, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
	~GameField ();

	void init ();

	void setGameController (GameController * _g);
	GameController * getGameController ();

	QSizePolicy sizePolicy() const;
	QSize sizeHint () const;

	QPopupMenu * menu;
	QPopupMenu * gMenu;
	QPopupMenu * iMenu;
	QPopupMenu * hMenu;


	int rows () const;
	int cols () const;
	int cellSize () const;
	int border () const;

protected:

    virtual void paintEvent( QPaintEvent * );
	virtual void mousePressEvent ( QMouseEvent * e ) ;
	virtual void mouseReleaseEvent ( QMouseEvent * e ) ;
	virtual void mouseMoveEvent ( QMouseEvent * e ) ;
	virtual void resizeEvent ( QResizeEvent * );
	virtual void leaveEvent ( QEvent * ) ;
	virtual void contextMenuEvent ( QContextMenuEvent * e );

private:
	GameController * gameController;
	int curI, curJ;

};

#endif /* !GAME_FIELD_H */